package cn.com.cym.gamezao.base;

import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.domain.Sort;
import javax.persistence.Column;
import javax.persistence.Transient;
import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import java.io.Serializable;
import java.util.List;


/**
 * 分页查询基类
 */
@Getter
@Setter
@NoArgsConstructor
public class SearchPage /*extends BaseEntity*/ implements Serializable {

    private static final long serialVersionUID = 5522850370875199329L;
    /**
     * 类名
     */
    @Column(length = 120)
    private String entityName;

    private List<ConditionItem> items;

    /**
     * 单页条数
     */
    @Min(value = 5L)
    @Max(value = 100L)
    Integer pageSize;

    /**
     * 当前页
     */
    @Min(value = 1L)
    Integer current;


    /**
     * 升降序号
     */
    Sort.Direction sort=Sort.Direction.ASC;


    /**
     * 排序条件
     */
    @Transient
    List<String> sortBy;
}
